new function
authorHavoc Pennington <hp@redhat.com>
Tue, 5 Jun 2001 20:45:33 +0000 (20:45 +0000)
committerHavoc Pennington <hp@src.gnome.org>
Tue, 5 Jun 2001 20:45:33 +0000 (20:45 +0000)
2001-06-05  Havoc Pennington  <hp@redhat.com>

* gtk/gtktoolbar.c (gtk_toolbar_remove_space): new function

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktoolbar.c
gtk/gtktoolbar.h

index f67f2a891887746425c7b407e49a59d2f3d65b67..252ae0b1e780266130b55f09523028ce9e4fa0be 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2001-06-05  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktoolbar.c (gtk_toolbar_remove_space): new function
+
 2001-06-05  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtkspinbutton.c (gtk_spin_button_set_range): clamp the value 
index f67f2a891887746425c7b407e49a59d2f3d65b67..252ae0b1e780266130b55f09523028ce9e4fa0be 100644 (file)
@@ -1,3 +1,7 @@
+2001-06-05  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktoolbar.c (gtk_toolbar_remove_space): new function
+
 2001-06-05  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtkspinbutton.c (gtk_spin_button_set_range): clamp the value 
index f67f2a891887746425c7b407e49a59d2f3d65b67..252ae0b1e780266130b55f09523028ce9e4fa0be 100644 (file)
@@ -1,3 +1,7 @@
+2001-06-05  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktoolbar.c (gtk_toolbar_remove_space): new function
+
 2001-06-05  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtkspinbutton.c (gtk_spin_button_set_range): clamp the value 
index f67f2a891887746425c7b407e49a59d2f3d65b67..252ae0b1e780266130b55f09523028ce9e4fa0be 100644 (file)
@@ -1,3 +1,7 @@
+2001-06-05  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktoolbar.c (gtk_toolbar_remove_space): new function
+
 2001-06-05  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtkspinbutton.c (gtk_spin_button_set_range): clamp the value 
index f67f2a891887746425c7b407e49a59d2f3d65b67..252ae0b1e780266130b55f09523028ce9e4fa0be 100644 (file)
@@ -1,3 +1,7 @@
+2001-06-05  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktoolbar.c (gtk_toolbar_remove_space): new function
+
 2001-06-05  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtkspinbutton.c (gtk_spin_button_set_range): clamp the value 
index f67f2a891887746425c7b407e49a59d2f3d65b67..252ae0b1e780266130b55f09523028ce9e4fa0be 100644 (file)
@@ -1,3 +1,7 @@
+2001-06-05  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktoolbar.c (gtk_toolbar_remove_space): new function
+
 2001-06-05  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtkspinbutton.c (gtk_spin_button_set_range): clamp the value 
index f67f2a891887746425c7b407e49a59d2f3d65b67..252ae0b1e780266130b55f09523028ce9e4fa0be 100644 (file)
@@ -1,3 +1,7 @@
+2001-06-05  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktoolbar.c (gtk_toolbar_remove_space): new function
+
 2001-06-05  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtkspinbutton.c (gtk_spin_button_set_range): clamp the value 
index 1008c0f0c0663cf4ea9526a80928569276ba7f23..93dbadc394352deead127d187a1ed41e6cb5b24d 100644 (file)
@@ -1159,6 +1159,46 @@ gtk_toolbar_insert_space (GtkToolbar *toolbar,
                              position);
 }
 
+void
+gtk_toolbar_remove_space (GtkToolbar *toolbar,
+                          gint        position)
+{
+  GList *children;
+  GtkToolbarChild *child;
+  gint i;
+  
+  g_return_if_fail (GTK_IS_TOOLBAR (toolbar));
+  
+  i = 0;
+  for (children = toolbar->children; children; children = children->next)
+    {
+      child = children->data;
+
+      if (i == position)
+        {
+          if (child->type == GTK_TOOLBAR_CHILD_SPACE)
+            {
+              toolbar->children = g_list_remove_link (toolbar->children, children);
+              g_free (child);
+              g_list_free (children);
+              toolbar->num_children--;
+              
+              gtk_widget_queue_resize (GTK_WIDGET (toolbar));
+            }
+          else
+            {
+              g_warning ("Toolbar position %d is not a space", position);
+            }
+
+          return;
+        }
+
+      ++i;
+    }
+
+  g_warning ("Toolbar position %d doesn't exist", position);
+}
+
 void
 gtk_toolbar_append_widget (GtkToolbar  *toolbar,
                           GtkWidget   *widget,
index 79d3d79dbceaf7d2db7e67871d4f7fd0da9050d8..62934110de23704bdb033c919efdb228e0b36dcc 100644 (file)
@@ -153,6 +153,8 @@ void       gtk_toolbar_append_space    (GtkToolbar      *toolbar);
 void       gtk_toolbar_prepend_space   (GtkToolbar      *toolbar);
 void       gtk_toolbar_insert_space    (GtkToolbar      *toolbar,
                                        gint             position);
+void       gtk_toolbar_remove_space    (GtkToolbar      *toolbar,
+                                        gint             position);
 
 /* Any element type */
 GtkWidget* gtk_toolbar_append_element  (GtkToolbar      *toolbar,